package cn.wolfcode.luowowo.article.query;

import cn.wolfcode.luowowo.common.query.QueryObject;
import lombok.Getter;
import lombok.Setter;

/**
 * @author 名字
 * @company 公司
 * @create 2019-09-26 9:26
 */
@Setter
@Getter
public class QuestionQuery extends QueryObject {
    public static final int TYPE_NEWEST = 0; //最新问答
    public static final int TYPE_HOT = 1; //热门问答

    private Integer state = -1; //状态

    private Integer type = TYPE_HOT;

    private String orderBy;


    public String getOrderBy() {
        switch (type) {
            case TYPE_HOT:
                return "viewnum Desc";
            default:
                return "createTime Desc";
        }
    }
}
